


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
			<script language="javascript" src="<%=path%>/application/js/treeSelect.js"></script>
	</head>
	<body>

<html:form styleId="yfStandardForm" action="listYfStandard.do?method=getYfStandardPartialList">
	<input type="hidden" id="totalPage" value="${totalPage}" />
	<input type ="hidden" name="bussType" id="bussType" value="${yfStandardForm.bussType}"/>
	<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12"></img>
						<c:if test="${yfStandardForm.bussType==0}">
						   标准规范 &gt; 公司政策
						</c:if>
						<c:if test="${yfStandardForm.bussType==1}">
						   标准规范 &gt; 招标规范
						</c:if>
						<c:if test="${yfStandardForm.bussType==2}">
						   标准规范 &gt; 开发规范
						</c:if>
					</td>
				</tr>
			</table>
			
			
			<table cellspacing="3" cellpadding="0" width="98%" align="center"
				border="0" class="kuang2 margtb5 hei12">
				<tr>
				    <c:if test="${yfStandardForm.bussType==0}">
						<td width="10%" align="right">
							<bean:message key="com.application.yfstandard.entity.yfstandard.listpage.fileName" bundle="yfstandard"/>：
						</td>
						<td width="15%">
							<html:text property="fileName"/>
	                	</td>
						 <td width="10%" align="right">
							<bean:message key="com.application.yfstandard.entity.yfstandard.listpage.operateid" bundle="yfstandard"/>：
						</td>
						<td width="15%">
							 <input type="text" value="${yfStandardForm.rname}" name="rname" id="rname" onClick="openTree('divTree','user_bm_o','${pageContext.request.contextPath}/common/treeSelect.jsp?iid=operateid&iname=rname',this)" />
		
							 <input type="hidden" value="" id="operateid" name="operateid" size="80" />
						 		  	<div id="divTree"
			style="position: absolute; background: #FFFFFF; left: 1px; top: 1px; height =300; width: 253px; display: none"></div>
	                	</td>
						<td width="50%">
							  <input  class="buttonbg"  style="cursor:hand"  id="but_query" type="button" value="<bean:message key='com.manager.common.yfstandard.query'  bundle="yfstandard"/>" name="but_query" onClick="query();" />
						</td>
					</c:if>
					 <c:if test="${yfStandardForm.bussType!=0}">
						<td width="10%" align="right">
							<bean:message key="com.application.yfstandard.entity.yfstandard.listpage.fileName" bundle="yfstandard"/>：
						</td>
						<td width="15%">
							<html:text property="fileName"/>
	                	</td>
						 <td width="10%" align="right">
							<bean:message key="com.application.yfstandard.entity.yfstandard.listpage.fileType" bundle="yfstandard"/>：
						</td>
						<td width="15%">
						     <c:if test="${yfStandardForm.bussType==1}">
							      <ssh:select propertyName="fileType" pid="ZBGF_TYPE" type="1" defaultName="${yfStandardForm.fileType}"/>
							</c:if>
							<c:if test="${yfStandardForm.bussType==2}">
							      <ssh:select propertyName="fileType" pid="KFGF_TYPE" type="1" defaultName="${yfStandardForm.fileType}"/>
							</c:if>
							     
	                	</td>
						 <td width="10%" align="right">
							<bean:message key="com.application.yfstandard.entity.yfstandard.listpage.operateid" bundle="yfstandard"/>：
						</td>
						<td width="15%">
							 <input type="text" value="${yfStandardForm.rname}" name="rname" id="rname" onClick="openTree('divTree','user_bm_o','${pageContext.request.contextPath}/common/treeSelect.jsp?iid=operateid&iname=rname',this)" />
		
							 <input type="hidden" value="" id="operateid" name="operateid" size="80" />
						 		  	<div id="divTree"
			style="position: absolute; background: #FFFFFF; left: 1px; top: 1px; height =300; width: 253px; display: none"></div>
	                	</td>
						<td width="25%">
							  <input  class="buttonbg"  style="cursor:hand"  id="but_query" type="button" value="<bean:message key='com.manager.common.yfstandard.query'  bundle="yfstandard"/>" name="but_query" onClick="query();" />
						</td>
					</c:if>
				</tr>
				
			</table>
			
			
		   <table cellspacing="0" cellpadding="0" width="98%" align="center" border="0" class="margb5">
				<tr>
					<td colspan="8" class="bgcolor2 padlr5">
						<table border="0" cellspacing="0" cellpadding="0" class="lan13b">
							<tr>
							<td width="25" align="center"> <img src="<%=applicationPath%>/images/tianjia.gif" alt="<bean:message key='com.manager.common.yfstandard.add'  bundle="yfstandard"/>" height="15" width="15" /></td>
					        <td class="lieb-zi" width="40">
						<a href="#" onClick="addYfStandard();" ><bean:message key='com.manager.common.yfstandard.add'  bundle="yfstandard"/>
						</a>
					</td>
					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/bianji.gif" alt="<bean:message key='com.manager.common.yfstandard.modify'  bundle="yfstandard"/>" height="15" width="15" />
					</td>
					<td class="lieb-zi" width="40">
					     <a href="#" onClick="modifyYfStandard();" ><bean:message key='com.manager.common.yfstandard.modify'  bundle="yfstandard"/> </a>
					</td>

					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/shanchu.gif" alt="<bean:message key='com.manager.common.yfstandard.del'  bundle="yfstandard"/>" height="15" width="15" />
					</td>
					<td class="lieb-zi" width="40">
						<a href="#" onClick="delYfStandard();" ><bean:message key='com.manager.common.yfstandard.del'  bundle="yfstandard"/></a>
					</td>


					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/chakan.gif" alt="<bean:message key='com.manager.common.yfstandard.view'  bundle="yfstandard"/>" height="15" width="15"/>
					</td>
					<td width="40" class="lieb-zi">
						<a href="#" onClick="view();"><bean:message key='com.manager.common.yfstandard.view'  bundle="yfstandard"/> </a>
					</td>
					<td class="lieb-zi">
						&nbsp;
					</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
			
		<fmt:bundle basename="com.application.yfstandard.struts.ApplicationResources_yfstandard">
		<display:table name="yfStandardList" class="simple" id="yfStandardTab" pagesize="15" partialList="true"   style=" width:100%;"   defaultorder="descending" size="resultSize" requestURI="listYfStandard.do?method=getYfStandardPartialList"  > 			       
									<display:column title="选择" sortable="false"  style=" width:5%; text-align:center;" >
									<input type="hidden" id="${yfStandardTab.id}operateid" name="${yfStandardTab.id}operateid" value="${yfStandardTab.operateid}"/>
			    <input type="checkbox" name="id" value="${yfStandardTab.id}" headerClass="sortable"/>
			</display:column>
																																							
				 <display:column   titleKey="com.application.yfstandard.entity.yfstandard.listpage.fileName" sortable="true" style="width:30%; text-align:center;">
				     <a style="color:blue;" href="#" onclick="showView('${yfStandardTab.id}')">${yfStandardTab.fileName}</a> 
				 </display:column>
			 										 
                       <c:if test="${yfStandardForm.bussType==1}">
						     <display:column property="fileType" titleKey="com.application.yfstandard.entity.yfstandard.listpage.fileType" sortable="true" style="width:15%; text-align:center;"  decorator="com.manager.commons.DictCodeColumnDecorator" dictCode="ZBGF_TYPE"/>
						</c:if>
			         <c:if test="${yfStandardForm.bussType==2}">
						     <display:column property="fileType" titleKey="com.application.yfstandard.entity.yfstandard.listpage.fileType" sortable="true" style="width:15%; text-align:center;"  decorator="com.manager.commons.DictCodeColumnDecorator" dictCode="KFGF_TYPE"/>
						</c:if>            												 
                         <display:column property="rname" titleKey="com.application.yfstandard.entity.yfstandard.listpage.operateid" sortable="true" style="width:15%; text-align:center;"/>
			                          												 
                                 <display:column format="{0,date,yyyy-MM-dd}" property="createDate" titleKey="com.application.yfstandard.entity.yfstandard.listpage.createDate" sortable="true" style="width:15%; text-align:center;" />
			                          							       </display:table>
	       </fmt:bundle>
		</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="listYfStandard.do?method=getYfStandardPartialList";
	document.forms[0].submit();
}

//新增
function addYfStandard(){
    document.forms[0].action="toAddYfStandard.do?method=toAddYfStandard";
	document.forms[0].submit();
}

//修改
function modifyYfStandard(){
    var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	        alert("一次只能编辑一条记录！");
		return;
	}else{
	 var cheid = getCheckId().trim();
	    var operateid = cheid + "operateid";
	    var opid = $(operateid).value;
	    var currentid = '${loginUser.id}';
	    if(opid != currentid){
	           alert("只能编辑自己新增的记录！");
	           return;
	    }
		document.forms[0].action="toUpdateYfStandard.do?method=toUpdateYfStandard";
	        document.forms[0].submit();
	}
	
}

function getCheckId(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	return jysBox[i].value;
		}
	}
    return count;
}

//删除
function delYfStandard()
{
	var ids = getSelectedIds('id');
	if( ids=="" )
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("是否要删除所选的信息？") )
	{
	    var cheid = getCheckId().trim();
	    var operateid = cheid + "operateid";
	    var opid = $(operateid).value;
	    var currentid = '${loginUser.id}';
	    if(opid != currentid){
	           alert("只能删除自己新增的记录！");
	           return;
	    }
		document.forms[0].action="deleteYfStandard.do?method=deleteYfStandard&ids=" + ids;
		document.forms[0].submit();
	}
}
	
	
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}

//查看
function view(){
	var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	    alert("一次只能查看一条记录！");
		return;
	}else{
		document.forms[0].action="viewYfStandard.do?method=viewYfStandard";
	    document.forms[0].submit();
	}
}

//查看
function showView(id){ 
    document.forms[0].action="viewYfStandard.do?method=viewYfStandard&id=" + id;
	document.forms[0].submit();

}
//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("id");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     }else{
        chk(i).checked=false; 
     } 
       
 }
  
}   
</script>
